home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / lisp / stk-3.003 / stk-3 / stk / 3.1 / demos / Wicon.stklos < prev    next >
Encoding:
Text File  |  1996-07-29  |  1.7 KB  |  43 lines

  1. ;;;;
  2. ;;;; STk adaptation of the Tk widget demo.
  3. ;;;;
  4. ;;;; This demonstration script creates a toplevel window containing
  5. ;;;; buttons that display bitmaps instead of text.
  6. ;;;;
  7.  
  8. (define (demo-icon)
  9.   (let* ((w     (make-demo-toplevel  "icon"
  10.                      "Iconic Button Demonstration"   
  11.                      "This window shows three ways of using bitmaps or images in radiobuttons and checkbuttons.  On the left are two radiobuttons, each of which displays a bitmap and an indicator.  In the middle is a checkbutton that displays a different image depending on whether it is selected or not.  On the right is a checkbutton that displays a single bitmap but changes its background color to indicate whether or not it is selected."))
  12.      (up    (make <Bitmap-Image> :file (string-append *STk-images* "flagup")))
  13.      (down  (make <Bitmap-Image> :file (string-append *STk-images* "flagdown")))
  14.      (left  (make <Frame> :parent w :border-width 10))
  15.      (right (make <Frame> :parent w :border-width 10)))
  16.  
  17.     ;; Create Radio buttons
  18.     (pack (make <Radio-button>
  19.             :parent left
  20.             :bitmap (string-append "@" *STk-images* "letters")
  21.             :variable 'letters
  22.             :value "full")          
  23.           (make <Radio-button>
  24.             :parent left
  25.             :bitmap (string-append "@" *STk-images* "noletters")
  26.             :variable 'letters
  27.             :value "empty")
  28.           :pady "3m")
  29.  
  30.     ;; Create check buttons
  31.     (pack (make <Check-button>
  32.             :parent right
  33.             :image down
  34.             :select-image up
  35.             :indicator-on #f)
  36.           (make <Check-button>
  37.             :parent right
  38.             :bitmap (string-append "@" *STk-images* "letters")
  39.             :indicator-on "0"
  40.             :select-color "SeaGreen1")
  41.           :side "left" :expand #t :padx "5m")
  42.     (pack left right :side "left" :expand #t)))
  43.